import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CourseEvaluateComponent } from './course-evaluate/course-evaluate.component';
import { EvaluateHistoryComponent } from './evaluate-history/evaluate-history.component';
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {ShareModule} from '../../share/share.module';
import {RouterModule, Routes} from '@angular/router';
import {SupervisionPageComponent} from './supervision-page.component';
import {LoginActivate} from '../../core/auth/login.activate';

const routes: Routes = [
  {
    path: '',
    component: SupervisionPageComponent,
    children: [
      {
        path: 'course-evaluate',
        component: CourseEvaluateComponent,
        data: {
          breadcrumb: '课程评价'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'evaluate-history',
        component: EvaluateHistoryComponent,
        data: {
          breadcrumb: '评价历史'
        },
        canActivate: [LoginActivate]
      },
      {
        path: '',
        redirectTo: 'to-be-evaluated',
        pathMatch: 'full'
      },
      {
        path: '**',
        component: CourseEvaluateComponent
      }
    ]
  }
];

@NgModule({
  declarations: [
    SupervisionPageComponent,
    CourseEvaluateComponent,
    EvaluateHistoryComponent
  ],
  imports: [
    CommonModule,
    NgZorroAntdModule,
    FormsModule,
    ReactiveFormsModule,
    ShareModule,
    RouterModule.forChild(routes),
  ]
})
export class SupervisionPageModule { }
